package com.power.sifa.info.dao;

import com.plf.common.domain.PageDataResponse;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;
import com.power.sifa.info.model.Law_doc;

import javax.transaction.Transactional;
import java.io.Serializable;
import java.util.List;

/**
 * 法律表 持久层(hibernate)
 */

public interface Law_docDao extends JpaRepository<Law_doc, Serializable>, JpaSpecificationExecutor<Law_doc>, Repository<Law_doc, Serializable>, Law_docDaoCustom<Law_doc, Serializable> {

   @Modifying
   @Transactional
   @Query("delete  from Law_doc s where  s.id in (:ids) ")
   void removeByIds(@Param("ids") List<Integer> ids);


   /**
    * 通过id来查询对应的文书数据
    * @param ids
    * @return
    */
   @Modifying
   @Transactional
   @Query(value = "select * from Law_doc s where  s.id in (:ids)", nativeQuery = true)
   List<Law_doc> findAllByIds (@Param("ids") List<String> ids);
}
